package la.iok.hzsvn.lewin.movie.operation.model;

import la.iok.hzsvn.share.excel.annotation.ExcelColumn;

import java.util.Date;

/**
 * 消费明细,包括充值记录ChargeOrder和开本记录PlayRecord
 */
public class ConsumeDetail {
    private Long id;
    /**
     * 交易类型,PlayRecord值恒为0，对应消费支出；ChargeOrder对应payType
     */
    private int type;
    private Long orgUnitId;
    @ExcelColumn(value = {"门店"}, width = 30,col = 1)
    private String orgUnitName;
    private Long roomId;
    @ExcelColumn(value = {"房间"}, width = 15,col = 2)
    private String roomName;
    /**
     * 操作账号;PlayRecord对应dmAccount,ChargeOrder对应username
     */
    @ExcelColumn(value = {"操作账号"}, width = 15,col = 3)
    private String operator;
    /**
     * 剧本名称。ChargeOrder则为空字符串
     */
    @ExcelColumn(value = {"剧本名称"}, width = 30,col = 4)
    private String movieName;
    /**
     * 开始时间。ChargeOrder对应prepareDate；PlayRecord就是startTime
     */
    @ExcelColumn(value = {"开始时间"}, width = 25,col = 5,dateFormat = "yyyy/mm/dd HH:mm:ss")
    private Date startTime;
    /**
     * 结束时间
     */
    @ExcelColumn(value = {"结束时间"}, width = 25,col = 6,dateFormat = "yyyy/mm/dd HH:mm:ss")
    private Date endTime;
    /**
     * 交易类型的字符串形式。导出excel时使用,不需要get/set方法
     */
    @ExcelColumn(value = {"交易类型"}, width = 15,col = 7)
    private String typeStr;
    /**
     * 金额。ChargeOrder就是amount；PlayRecord对应cost
     */
    private Integer amount;
    @ExcelColumn(value = {"金额(元)"}, width = 15,col = 8,builtinFormat = "0.00")
    private Float amountY;
    /**
     * 优惠扣减。ChargeOrder为0；
     */
    private Integer luckyAmount;
    @ExcelColumn(value = {"优惠扣减(元)"}, width = 15,col = 9,builtinFormat = "0.00")
    private Float luckyAmountY;
    /**
     * 实扣金额。ChargeOrder与amount一致
     */
    private Integer payAmount;
    @ExcelColumn(value = {"实扣(元)"}, width = 15,col = 10,builtinFormat = "0.00")
    private Float payAmountY;
    /**
     * 账户余额
     */
    private Integer accountRemained;
    @ExcelColumn(value = {"交易完成时余额(元)"}, width = 17,col = 11,builtinFormat = "0.00")
    private Float accountRemainedY;
    @ExcelColumn(value = {"备注"}, width = 15,col = 12)
    private String remark;
    /**
     * 排序时间字段，以金额实际变动时间为准。ChargeOrder对应endTime；PlayRecord对应startTime
     */
    private Date orderTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
        this.typeStr = type == 0?"消费支出":(type==1?"微信充值":(type==2?"支付宝充值":"管理员直充"));
    }

    public Long getOrgUnitId() {
        return orgUnitId;
    }

    public void setOrgUnitId(Long orgUnitId) {
        this.orgUnitId = orgUnitId;
    }

    public String getOrgUnitName() {
        return orgUnitName;
    }

    public void setOrgUnitName(String orgUnitName) {
        this.orgUnitName = orgUnitName;
    }

    public Long getRoomId() {
        return roomId;
    }

    public void setRoomId(Long roomId) {
        this.roomId = roomId;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getMovieName() {
        return movieName;
    }

    public void setMovieName(String movieName) {
        this.movieName = movieName;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getTypeStr() {
        return typeStr;
    }

    public void setTypeStr(String typeStr) {
        this.typeStr = typeStr;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
        if(amount != null){
            this.amountY = ((float)amount)/100.0f;
        }

    }

    public Integer getLuckyAmount() {
        return luckyAmount;
    }

    public void setLuckyAmount(Integer luckyAmount) {
        this.luckyAmount = luckyAmount;
        if(luckyAmount != null){
            this.luckyAmountY = ((float)luckyAmount/100.0f);
        }
    }

    public Integer getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Integer payAmount) {
        this.payAmount = payAmount;
        if(payAmount != null){
            this.payAmountY = ((float)payAmount/100.0f);
        }
    }

    public Integer getAccountRemained() {
        return accountRemained;
    }

    public void setAccountRemained(Integer accountRemained) {
        this.accountRemained = accountRemained;
        if(accountRemained != null){
            this.accountRemainedY = ((float)accountRemained/100.0f);
        }
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
